// 根据角色动态生成路由
import { MockMethod } from "vite-plugin-mock";

export default [
  {
    url: "/v1/operator/login",
    method: "post",
    response: ({ body }) => {
      if (body.username === "15731973619") {
        return {
          code: 0,
          data: "eyJhbGciOiJIUzUxMiJ9.admin"
        };
      } else {
        return {
          code: 0,
          data: "eyJhbGciOiJIUzUxMiJ9.common"
        };
      }
    }
  },
  {
    url: "/v1/role/my",
    method: "post",
    response: () => {
      return {
        code: 0,
        data: [
          {
            roleId: "63a2a5e0eef6c16124505453",
            roleKey: "r_certificate_admin",
            name: "证书管理"
          },
          {
            roleId: "6131d6ae1ab57e098c73fa99",
            roleKey: "r_review_admin",
            name: "阅卷管理"
          }
        ]
      };
    }
  },
  {
    url: "/v1/operator/info",
    method: "post",
    response: () => {
      return {
        code: 0,
        message: "ok",
        data: {
          operatorUuid: "60feb2d08c3bee9917afc552",
          companyUuid: "60feb6af8c3bee9917afd3b6",
          loginName: "13901234567",
          accountNonLocked: true,
          realName: "国考云超管",
          mobile: "13901234567",
          email: "admin@iguokao.net",
          type: 3,
          loginTimes: 2535,
          remark: null,
          companyName: "考试管理公司",
          isCompanyAdmin: true,
          backgroundColor: null,
          position: null,
          companyShortName: "国考云",
          roleKeyList: ["r_sys_admin"],
          jobUuid: null,
          isOnline: null
        }
      };
    }
  }
] as MockMethod[];
